Parse Var Result VerThingy ' ' OpalName ' ' VersionNum ' ' DateNum
If Left(VersionNum,3) < 2.3 Then Do
AskBool 'It appears that you are using OpalPaint v' || VersionNum || '\n\nField-Machine requires OpalPaint v2.3 or higher\n\nShall I continue?'
If Result = 0 Then Do
Okay 'Exiting...'
Exit
End
End
If Exists('LIBS:rexxsupport.library') = 0 Then Do
Okay 'FATAL ERROR! You are missing the rexxsupport.library\nfrom your LIBS: directory. Check your Arexx\ninstallation.\n\nExiting...'
Exit
End
Call ADDLIB('rexxsupport.library',0,-30,0)
Iff = 0
Iff2 = 0
DeleteBool = 0
PALBool = 0
Call CheckSparePages()
Call CheckForSten()
Menu DISABLE
Call ConfirmFieldMachine()
/* Turn off Brush Outlines */
Call NoOutlines()
Call GetDefaultPath()
Call GetAnimPath()
Call WriteDefaultpath()
Call MakeDestPath()
Call GetFrameNumbers()
Call GetFieldMode()
Okay 'Here we go.'
A = StartFrame
Call GetTokens()
Do Forever
B = (A * 2) + 1
If A = EndFrame Then Leave
Call GetIFF()
Call Panic()
Call LookForFieldA()
Call LoadFieldA()
Call ResizeAndStampImage()
Call Panic()
Call AddSparePage()
Call Panic()
Call LookForFieldB()
Call LoadFieldB()
Call ResizeAndStampImage()
Call Panic()
Call GoToFirstPage()
/* SetUp Stencil for First Page */
Call Panic()
Call LoadStencil()
/* Enable RubThrough */
Call Rub()
Call SaveImage()
A = A + 1
End
Address Command
'Delete Ram:FieldMachine.Brush Quiet'
Address 'OpalPaint_Rexx'
Okay 'Operation Complete'
Exit
CheckSparePages:
Address 'OpalPaint_Rexx'
PickPage 1
OpenPages
NumPages = Result
If NumPages ~= 1 Then Do
Okay 'FATAL ERROR:\nThis script must not be run when OpalPaint has more than one page open.\nSave all your pages and delete them so I can start with one page.\n\nExiting...'
Exit
End
Return
CheckForSten:
Address 'OpalPaint_Rexx'
Finder = Exists('Images24:Stencils/FieldMachine.Sten')
If Finder = 0 Then Do
Okay 'FATAL ERROR: I cannot find the FieldMachine.Sten file in your\nImages24:Stencils directory. Please properly install\nthe Field Machine before running it!.'
Okay 'Exiting...'
Exit
End
Return
ConfirmFieldMachine:
Address 'OpalPaint_Rexx'
ReqBuild '420 130 " "'
AddBox '10 10 400 110'
AddBox '15 15 5 5 Raised'
AddBox '-20 15 5 5 Raised'
AddBox '15 -20 5 5 Raised'
AddBox '-20 -20 5 5 Raised'
AddBox '47 -53 109 31'
AddBox '-153 -53 106 31'
AddHeading 'CenterX 20 "Field Machine v1.1"'
AddHeading 'CenterX 35 "an Arexx script for OpalPaint v2.3 or higher"'
AddHeading 'CenterX 45 "by Carmen Rizzolo"'
AddGadget 'Button NTSCButton 50 -25 Small "NTSC"'
AddGadget 'Button PALButton 103 -25 Small "PAL"'
AddGadget 'Button NoButton -50 -25 Medium "Quit"'
Request NoOK NoCancel
GadgetStatus NTSCButton
If Result = 1 Then PALBool = 0
GadgetStatus PALButton
If Result = 1 Then PALBool = 1
GadgetStatus NoButton
If Result = 1 Then Do
Exit
End
Return PALBool
NoOutlines:
Address 'OpalPaint_Rexx'
GetPrefs
Prefs = Result
If (Prefs//2048)<1024 Then Do
NewPrefs=Prefs+1024
SetPrefs NewPrefs
End
Return
GetDefaultPath:
Address 'OpalPaint_Rexx'
If Open('DefaultFile','OpalPaint:Rexx/FieldMachineDefault.TXT','r') = 1 Then Do
AnimPathDefault = ReadLn('DefaultFile')
Chucky = Close('DefaultFile')
End
Else Do
AnimPathDefault = 'Imagine:FieldAnim.imp/a.pix/'
End
Return AnimPathDefault
GetAnimPath:
Address 'OpalPaint_Rexx'
PathWarn = 1
Do Forever
LeaveBool = 1
ReqBuild '450 161 "Choose animation pathname"'
AddBox '10 23 430 105'
AddText 'CenterX 29 "NOTE: Pathnames must end with a / character"'